import '../css/common/base'
import '../css/hotadvisory'
import Vue from 'vue'
import './common/appInit'
import dataHelper from './common/dataHelper'
import toolPackage from './common/toolPackage'
import vueLazyload from 'vue-lazyload'
import comHeader from '../../components/comHeader.vue'
new Vue({
    el: 'body',
    data: {
        title: '热门咨询问答',
        srcs: [
        'http://pic.58pic.com/58pic/13/72/07/55Z58PICKka_1024.jpg',
        'http://pic.58pic.com/58pic/16/69/40/34H58PICCJM_1024.jpg',
        'http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1206/06/c0/11901562_1338966836580_800x800.jpg',
        'http://pic10.nipic.com/20101103/5063545_000227976000_2.jpg',
        'http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1207/24/c1/12524786_1343121025385_800x800.jpg'
        ]
    },
    created(){
        Vue.use(vueLazyload, {
          error: require('../img/default.png'),
          loading: require('../img/dfloading.gif'),
          try: 3
        });
    },
    ready(){
        $('.list i').filter(function(i){
            $(this).find('img').on('load',function(){
                var i_h=$(this).parent().height(),$cur_img=$(this),img_h=$cur_img.height();
                $cur_img.css('margin-top',0);
                if(i_h>img_h){
                    $cur_img.css('height','100%');
                }else if(i_h<img_h){
                    var c=(img_h-i_h)/2;
                    $cur_img.css('margin-top',-c+'px');
                }
            });
        });
    },
    components : {
        comHeader
    }
});